Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DatePickerAndroid with mode spinner on Android Nougat(7.0) #24739

Closed
wants to merge 1 commit into from
Closed

Fix DatePickerAndroid with mode spinner on Android Nougat(7.0) #24739

wants to merge 1 commit into from

Conversation

luancurti
Copy link
Contributor

@luancurti luancurti commented May 7, 2019

When mode is spinner in Android Nougat the DatePicker shows calendar

Summary

I got it from https://gist.github.com/jeffdgr8/6bc5f990bf0c13a7334ce385d482af9f and
did some adjustments in order to work with DatePicker. Workaround for this bug: https://code.google.com/p/android/issues/detail?id=222208. In Android 7.0 Nougat, spinner mode for the DatePicker in DatePickerDialog is incorrectly displayed as calendar.

Changelog

[Android][Fixed] Fix date picker with mode spinner on Android Nougat (7.0)

Test Plan

Run RNTester with Simulator that has Android Nougat (7.0)
Search DatePickerAndroid
Click in Simple spinner date picker

datepicker_android

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 7, 2019
@dulmandakh
Copy link
Contributor

@luancurti I looked into the Android issue tracker and it seems that issue exists only on Android 7.0, so it might be best to use fixSpinner on Android 7.0. Could you please change and check that it works for other versions?

@luancurti
Copy link
Contributor Author

Hi @dulmandakh I tested only on Android Nougat but now I retested again in this Android versions 5.0, 7.0 and 9.0, and I changed this line if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { to only affect the Android Nougat because in another versions the RNTester crash because DatePickerAndroid thanks to remember!

Below are the test screenshots.

Android 5.0

Screenshot_1558058858

Android 7.0

Screenshot_1558059799

Android 9.0

Screenshot_1558059211

When mode is spinner in Android Nougat the DatePicker shows calendar
@dulmandakh dulmandakh requested a review from cpojer May 17, 2019 02:55
Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @luancurti in bb060d6.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 17, 2019
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
…ook#24739)

Summary:
When mode is spinner in Android Nougat the DatePicker shows calendar

I got it from https://gist.github.com/jeffdgr8/6bc5f990bf0c13a7334ce385d482af9f and
did some adjustments in order to work with `DatePicker`. Workaround for this bug: https://code.google.com/p/android/issues/detail?id=222208. In Android 7.0 Nougat, spinner mode for the DatePicker in DatePickerDialog is incorrectly displayed as calendar.

## Changelog

[Android][Fixed] Fix date picker with mode spinner on Android Nougat (7.0)
Pull Request resolved: facebook#24739

Differential Revision: D15391354

Pulled By: cpojer

fbshipit-source-id: 09f45367250aa14857a9c68846c7f2ce7c49ee3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants